<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

/**
 * @title 接口返回json数据
 * @param bool $success true成功false失败
 * @param string $resultMsg 信息描述
 * @param array $resultCode  异常代码 0正常 1token失效 2非空项为空
 * @return string $resul 返回数据
 */
function api_return($resul = [], $resultMsg = null, $success = true, $resultCode = 0)
{
    $result = [
        'success' => $success, 
        'resultMsg' => $resultMsg, 
        'resultCode' => $resultCode,
        'resul' => $resul
    ];
    return json($result);
}
